#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <fcntl.h>
#include <Gal.h>

/// <summary>
/// TODO
/// </summary>
SurfacePtr FPDCreateWindowSurface(void)
{
	SurfacePtr surface;
	if (!(surface = GalCreateMemorySurface(32, 1, 1)))
		return NULL;

	surface->width = 1;
	surface->height = 1;
	surface->refcount = 1;

	return surface;
}

/// <summary>
/// TODO
/// </summary>
SurfacePtr FPDCreateDisplaySurface(void)
{
	SurfacePtr surface;
	if (!(surface = GalCreateSurface()))
		return NULL;

	surface->width = 0;
	surface->height = 0;
	surface->data = NULL;
	surface->type = GAL_SURFACE_DISPLAY;
	surface->stride = 0;
	surface->refcount = 1;

	return surface;
}

/// <summary>
/// TODO
/// </summary>
int FPDModifySurface(SurfacePtr surface, int width, int height, int bpp)
{
	if (!surface)
		return -1;

	surface->width = width;
	surface->height = height;
	surface->stride = (width * (bpp / 8));
	surface->bpp = bpp;

	return 0;
}
